<template>
  <hips-view sub-header-fixed>
    <hips-nav-bar
      slot="header"
      title="媒体类"
      :back-button="{
        showLeftArrow: true,
      }"
      @nav-bar-back-click="$router.back()"
    />
    <demo-block title="startRecordTransform">
      <hips-button
        @click="startRecordTransformFuc"
      >
        语言转文字-开始录音
      </hips-button>
    </demo-block>

    <demo-block title="endRecordTransform">
      <hips-button
        @click="endRecordTransformFuc"
      >
        语言转文字-结束录音
      </hips-button>
    </demo-block>
  </hips-view>
</template>

<script>
import BasicView from '@/mixin/basic-view';
import { Button } from '@hips/vue-ui';
import { Media } from '@hips/plugin-vue-jssdk';

const { startRecordTransform, endRecordTransform } = Media;

export default {
  components: {
    [Button.name]: Button,
  },
  mixins: [ BasicView ],
  data() {
    return {};
  },
  methods: {
    startRecordTransformFuc() {
      startRecordTransform()
        .then((res) => {
          console.log('res = ', res);
        })
        .catch((err) => {
          console.log('err = ', err);
        });
    },

    endRecordTransformFuc() {
      endRecordTransform()
        .then((res) => {
          console.log('res = ', res);
        })
        .catch((err) => {
          console.log('err = ', err);
        });
    },
  },
};
</script>

<style lang="stylus"></style>
